package com.tdk.bts.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {

	private static final String DEFAULT_PATTERN = "yyyy-MM-dd HH:mm:ss";
	
	public static String date2String(Date date) 
	{	
		return date2String(date, DEFAULT_PATTERN);
	}

	public static String date2String(Date date,String pattern) 
	{
		if(date == null)
		{
			return "暂无日期";
		}
		if(pattern == null)
		{
			pattern = DEFAULT_PATTERN;
		}
		SimpleDateFormat sf = new SimpleDateFormat(pattern);
		return sf.format(date);
	}
	
	

}
